import {request} from "@/utils/request.js"

// 获取营业状态
export function getStatus() {
	return request({
		url: "/shop/status",
		method: "get"
	})

}

// 登录
export function login(data) {
	return request({
		url: "/user/login",
		method: "post",
		data
	})
}

// 获取用户信息
export function getUserInfo() {
	return request({
		url: "/user",
		method: "get"
	})
}

// 修改用户信息
export function updateUserInfo(data) {
	return request({
		url: "/user",
		method: "put",
		data
	})
}


// 查询启用的部门
export function getEnableDepartment() {
	return request({
		url: "/department",
		method: "get"
	})
}

// 根据部门id查询该部门下的医护信息
export function getStaffEnableByDepartmentId(departmentId) {
	return request({
		url: "/staff/department/" + departmentId,
		method: "get"
	})
}

// 下单接口
export function createOrder(id) {
	return request({	
		url: "/orders/create/" + id,
		method: "post"
	})
}

// 支付接口
export function payOrder(data) {
	console.log(data);
	return request({
		url: "/orders/pay",
		method: "put",
		data: {
			orderNumber: data,
		}
	})
}

// 历史订单列表
export function getOrderList(data) {
	return request({
		url: "/orders/history",
		method: "get",
		data
	})
}

// 查询所有轮播图
export function getBannerList() {
	return request({
		url: "/banners",
		method: "get"
	})
}

// 查询所有公告
export function getAnnouncementList() {
	return request({
		url: "/announcement",
		method: "get"
	})
}

// 根据id查询公告
export function getAnnouncementById(id) {
	return request({
		url: "/announcement/"+id,
		method: "get"
	})
}